package com.csun.cmny.provider.service;


import com.csun.cmny.base.dto.LoginAuthDto;
import com.csun.cmny.provider.model.dto.life.LifeRoomIndexDto;
import com.csun.cmny.provider.model.dto.life.LifeRoomQueryDto;
import com.csun.cmny.provider.model.dto.oldmanApp.AppRoomDto;
import com.csun.cmny.provider.model.vo.LifeRoomBuildingVo;
import com.csun.cmny.provider.model.vo.RoomBuildingVo;
import com.csun.cmny.provider.model.vo.RoomInfoLifeVo;
import com.csun.cmny.provider.model.vo.RoomInfoVo;
import com.csun.cmny.provider.model.vo.life.LifeIndexRoomVO;
import com.csun.cmny.provider.model.vo.life.LifeRoomVO;
import com.csun.cmny.provider.pojo.Room;
import com.csun.cmny.provider.vo.RoomSleepInfo;
import com.csun.cmny.provider.vo.RoomWithOtherVo;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public interface RoomService {

    /**
     * 添加房间
     * author:liqian
     * date:2018-11-12 11:09
     */
    int insert(Room room);
    /**
     * 删除房间
     * author:liqian
     * date:2018-11-12 11:10
     */
    int deleteById(Integer roomId);
    /**
     * 修改房间
     * author:liqian
     * date:2018-11-12 11:11
     */
    int updateById(Room room);
    /**
     * 根据房间id查询房间信息——不包含床位信息
     * author:liqian
     * date:2018-11-12 11:12
     */
    Room selectById(Integer roomId);
    /**
     * 查询该机构的所有房间信息
     * author:liqian
     * date:2018-11-12 13:46
     */
    List<Room> showAll(Map<String, Object> queryMap);
    /**
     * 查询该楼栋的信息(床位编号方式:1 按房间计数 2 按楼层计数)及房间信息
     * author:liqian
     * date:2018-11-12 16:46
     */
    Map<String,Object> selectBuildingAndRoom(Integer roomId);
    /**
     * 根据room尝试下room
     * author:liqian
     * date:2018-11-13 11:12
     */
    Room selectByRoom(Room room1);
    /**
     * 根据楼栋id和楼层号查询出该层床位号最大的床位号
     * author:liqian
     * date:2018-11-13 13:28
     */
    List<Map<String,Object>> selectByBidAndFno(Integer buildingId, Integer floorNo);
    /**
     * 根据楼栋id和楼层号查询房间及床位
     * author:liqian
     * date:2018-11-13 16:00
     */
    List<Room> selectRooms(Room room);

    /**
     * 根据楼栋id和楼层号查询房间及床位和其它信息
     * author:chenzheng
     * date:2019-09-05
     */
    List<RoomWithOtherVo> selectRoomsWithOther(Room room);
    /**
     * 根据房间id查询房间信息——包含床位信息
     * author:liqian
     * date:2018-11-14 14:43
     */
    Room selects(Integer roomId);

    /**
     * query room building list
     *
     * @param roomIdList   room id list
     *
     * @return  the list.
     */
    List<RoomBuildingVo> queryRoomBuildingList(List<Integer> roomIdList);

    /**
     * query room building by room id
     *
     * @param roomId    room id
     *
     * @return          the room building vo
     */
    RoomBuildingVo queryRoomBuildingByRoomId(Integer roomId);

    /**
     * 校验房间别名是否存在
     *
     * @param roomCheck 房间条件
     *
     * @return  true-不存在 false-存在
     */
    boolean checkRoomAlias(Room roomCheck);

    /**
     * 根据楼栋、楼层查询房间信息
     * @param: [buildingId, floorNo, loginAuthDto]
     * @return: java.util.List<com.csun.cmny.provider.model.vo.RoomInfoVo>
     */
    List<RoomInfoVo> queryRoomInfo(Integer buildingId, Integer floorNo, Integer roomId, LoginAuthDto loginAuthDto);

    /**
     * life-首页查询房间列表
     * @date 2019/12/31 13:25
     * @param
     * @return com.csun.cmny.provider.service.RoomService
     */
    List<RoomInfoLifeVo> queryRoomInfoLife();

    /**
     * 根据房间id查询老人id
     * @param roomId
     * @return com.csun.cmny.provider.service.RoomService
     */
    Long selectOldByRoomId(Long roomId);

    /**
     * 添加Life集团房屋
     * @param room, loginAuthDto
     * @return com.csun.cmny.provider.service.RoomService
     */
    Integer saveLifeRoom(Room room, LoginAuthDto loginAuthDto);

    /**
     * life集团房间-分页查询
     * @param lifeRoomQuertDto
     * @return com.csun.cmny.provider.service.RoomService
     */
    List<LifeRoomVO> queryListWithPage(LifeRoomQueryDto lifeRoomQuertDto);

    /**
     * life集团-房间详情
     * @date 2019/12/31 13:20
     * @param roomId
     * @return com.csun.cmny.provider.service.RoomService
     */
    LifeRoomVO getById(Long roomId);

    /**
     * life-删除房间
     * @date 2019/12/31 13:25
     * @param lifeRoomId
     * @return com.csun.cmny.provider.service.RoomService
     */
    Integer deleteLifeRoomById(Long lifeRoomId);

    /**
     * life-首页查询房间列表
     * @param lifeRoomQuertDto
     * @return com.csun.cmny.provider.service.RoomService
     */
    List<LifeIndexRoomVO> queryIndexRooms(LifeRoomIndexDto lifeRoomQuertDto);

    /**
     * life-房间详情页
     * @param roomId 房间id, groupId机构id
     * @return com.csun.cmny.provider.service.RoomService
     */
    List<LifeIndexRoomVO> lifeRoom(Long roomId, Long groupId);

    /**
     * life查询未入住入居者的房间
     * @param lifeRoomQuertDto
     * @return
     */
    List<LifeRoomVO> notLifeRooms(LifeRoomQueryDto lifeRoomQuertDto);

    /*
    * 根据机构id查询life房间
    * */
    List<LifeRoomBuildingVo> listRoomByGroupId(Long groupId);

    /*
    * app用户添加房间
    * */
    Integer userAddRoom(AppRoomDto appRoomDto, LoginAuthDto loginAuthDto);

    /**
     * 守护佳个人床垫数据
     * @return Wrapper
     * @author HD
     * @date 2021/12/16 10:08
     */
    List<RoomSleepInfo> roomSleepInfo(Long groupId);

    List<RoomSleepInfo> queryRoomSleepInfo(ArrayList<Long> ids);
}
